 function [xnod,icone] = mesh_square(Lx,Nx,Ly,Ny,refx,refy,type)
    
    x        = refh(refx,Nx+1)*Lx;
    y        = refh(refy,Ny+1)*Ly;

    %revisar cuando Nx!=Ny
    
%     sxy = sortrows([x y],[2 1]);
%     x = sxy(:,1);
%     y = sxy(:,2);
%     
    [xnod,icone] = qq3d(x,y);
    if strcmp(type,'triangles')
        [icone] = quad2tri(icone);
    end
    
 end